using UnityEngine;
using System.Collections;

public class Credits : MonoBehaviour {

	// Use this for initialization
	public Texture backActive;
	public Texture backInactive;
	
	Rect backActiveRect;
	
	Texture backTex;
	
	void Start () {
		
	float middle_x = (Screen.width/2);
	float middle_y = 5*(Screen.height/6);
		
	backActiveRect = new Rect(middle_x-128,middle_y-32,264,52);
	
	
	backTex = backInactive;
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	void OnGUI () {
		Vector2 mouse = Input.mousePosition;
		
		if (backActiveRect.Contains(new Vector2(mouse.x, Screen.height - mouse.y))) {
			backTex = backActive;
		}
		else
		{
			backTex = backInactive;
		}
		if(GUI.Button(backActiveRect, backTex, GUIStyle.none)) {
			Application.LoadLevel("IntroScene");
		}
  }
}
